const express = require('express')
const router = express.Router()
const userController = require(process.cwd() + '/controllers/userControllers')

router.post('/registe',userController.createUser)
router.post('/login',userController.login)
router.put('/updateUserById/:userId',userController.updateUserById)
router.get('/afterlogin',userController.afterLogin)
router.get('/getUserAllInfo',userController.getUserAllInfo)
router.put('/initUserInfo',userController.initUserInfo)
router.put('/updateUserBasicInfo',userController.updateUserBasicInfo)
router.put('/upload-avatar',userController.upload.single('avatar'),userController.uploadAvatar)
router.get('/getAvatar',userController.getAvatar)
router.get('/getAllUsers',userController.checkAdminPermission ,userController.getAllUsers)
router.delete('/deleteUserById/:userId',userController.checkAdminPermission,userController.deleteUserById)
module.exports = router
